home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / SCGetEventFD.z / SCGetEventFD
Text File  |  1998-10-30  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. SSSSCCCCGGGGEEEETTTTEEEEVVVVEEEENNNNTTTT((((3333))))                    IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                     SSSSCCCCGGGGEEEETTTTEEEEVVVVEEEENNNNTTTT((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SCGetEventFD, SCEventPending, SCGetEvent - Receiving events from scanner
  10.      drivers
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttddddiiiioooo....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccaaaannnnnnnneeeerrrr....hhhh>>>>
  15.  
  16.      iiiinnnntttt SSSSCCCCGGGGeeeettttEEEEvvvveeeennnnttttFFFFDDDD((((SSSSCCCCAAAANNNNNNNNEEEERRRR ****ssss))));;;;
  17.  
  18.      iiiinnnntttt SSSSCCCCEEEEvvvveeeennnnttttPPPPeeeennnnddddiiiinnnngggg((((SSSSCCCCAAAANNNNNNNNEEEERRRR ****ssss))));;;;
  19.  
  20.      iiiinnnntttt SSSSCCCCGGGGeeeettttEEEEvvvveeeennnntttt((((SSSSCCCCAAAANNNNNNNNEEEERRRR ****ssss,,,, SSSSCCCCEEEEVVVVEEEENNNNTTTT ****eeeevvvveeeennnntttt))));;;;
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      Scanner applications need to be prepared to receive events from scanner
  24.      drivers.  Events are used to inform the scanner application that it must
  25.      reread configuration information about the scanner; this is the
  26.      information obtained by calls to _S_C_G_e_t_P_a_g_e_S_i_z_e(3), _S_C_G_e_t_M_i_n_M_a_x_R_e_s(3),
  27.      _S_C_G_e_t_S_c_a_n_n_e_r_R_e_s(3), _S_C_G_e_t_D_a_t_a_T_y_p_e_s(3), and _S_C_F_e_e_d_e_r_G_e_t_F_l_a_g_s(3).
  28.  
  29.      For example, some scanners with transparency units have different scan
  30.      areas depending on whether transparent or reflective media is being
  31.      scanned.  In this scenario, the user would indicate to the driver which
  32.      media was present using the scanner specific options program, and if this
  33.      changed the effective scanning area the driver would then inform the
  34.      application of the change by sending an event.
  35.  
  36.      _S_C_G_e_t_E_v_e_n_t_F_D returns a file descriptor that can be passed to the
  37.      _s_e_l_e_c_t(2) system call; when _s_e_l_e_c_t indicates that the file descriptor is
  38.      ready for reading then there is an event pending.  _S_C_E_v_e_n_t_P_e_n_d_i_n_g returns
  39.      1 if an event is currently pending or 0 otherwise.  Scanner applications
  40.      should either pass the return value of _S_C_G_e_t_E_v_e_n_t_F_D to the _s_e_l_e_c_t system
  41.      call, or arrange to periodically call _S_C_E_v_e_n_t_P_e_n_d_i_n_g.
  42.  
  43.      _S_C_G_e_t_E_v_e_n_t retrieves a pending event.  _e_v_e_n_t is a pointer to an EEEEVVVVEEEENNNNTTTT
  44.      structure, which is defined in /_u_s_r/_i_n_c_l_u_d_e/_s_c_a_n_n_e_r_s._h as follows:
  45.  
  46.           typedef struct tag_infoChange {
  47.               unsigned int pageSizeChanged : 1;
  48.               unsigned int resolutionChanged : 1;
  49.               unsigned int dataTypesChanged : 1;
  50.               unsigned int feederFlagsChanged : 1;
  51.           } SCINFOCHANGE;
  52.  
  53.           #define SCEVENT_INFOCHANGE 1
  54.  
  55.           typedef struct tag_scevent {
  56.               unsigned int eventType;
  57.               union {
  58.                SCINFOCHANGE infoChange;
  59.               } event;
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSCCCCGGGGEEEETTTTEEEEVVVVEEEENNNNTTTT((((3333))))                    IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                     SSSSCCCCGGGGEEEETTTTEEEEVVVVEEEENNNNTTTT((((3333))))
  71.  
  72.  
  73.  
  74.           } SCEVENT;
  75.  
  76.  
  77.      After calling _S_C_G_e_t_E_v_e_n_t, _e_v_e_n_t->_e_v_e_n_t_T_y_p_e should be compared to
  78.      SSSSCCCCEEEEVVVVEEEENNNNTTTT____IIIINNNNFFFFOOOOCCCCHHHHAAAANNNNGGGGEEEE before assuming that _e_v_e_n_t->_e_v_e_n_t._i_n_f_o_C_h_a_n_g_e is valid;
  79.      future versions of Impressario may expand upon the event mechanism.
  80.  
  81.      If _e_v_e_n_t->_e_v_e_n_t._i_n_f_o_C_h_a_n_g_e._p_a_g_e_S_i_z_e_C_h_a_n_g_e_d is 1, then the application
  82.      should call _S_C_G_e_t_P_a_g_e_S_i_z_e to query the changed scanning area; if _e_v_e_n_t-
  83.      >_e_v_e_n_t._i_n_f_o_C_h_a_n_g_e._r_e_s_o_l_u_t_i_o_n_C_h_a_n_g_e_d is 1, then the application should
  84.      call _S_C_G_e_t_M_i_n_M_a_x_R_e_s and _S_C_G_e_t_S_c_a_n_n_e_r_R_e_s to query the changed resolutions;
  85.      if _e_v_e_n_t->_e_v_e_n_t._i_n_f_o_C_h_a_n_g_e._d_a_t_a_T_y_p_e_s_C_h_a_n_g_e_d is 1, then the application
  86.      should call _S_C_G_e_t_D_a_t_a_T_y_p_e_s to query the changed data types; and if
  87.      _e_v_e_n_t->_e_v_e_n_t._i_n_f_o_C_h_a_n_g_e._f_e_e_d_e_r_F_l_a_g_s_C_h_a_n_g_e_d is 1, then the application
  88.      should call _S_C_F_e_e_d_e_r_G_e_t_F_l_a_g_s to query the changed feeder flags.
  89.  
  90.      For all functions, _s is a SSSSCCCCAAAANNNNNNNNEEEERRRR pointer returned by a call to
  91.      _S_C_O_p_e_n(3), _S_C_O_p_e_n_F_i_l_e(3), or _S_C_O_p_e_n_S_c_r_e_e_n(3).
  92.  
  93. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  94.      _S_C_G_e_t_E_v_e_n_t_F_D returns a file descriptor that should be passed to _s_e_l_e_c_t;
  95.      when _s_e_l_e_c_t indicates that the file descriptor is ready for reading then
  96.      there is an event pending.
  97.  
  98.      _S_C_E_v_e_n_t_P_e_n_d_i_n_g returns 1 if an event is pending, 0 if no events are
  99.      pending, and -1 if an error occurs.
  100.  
  101.      _S_C_G_e_t_E_v_e_n_t returns 0 if an event was successfully retrieved and -1 if an
  102.      error occurred.
  103.  
  104.      In the event of an error, _S_C_E_v_e_n_t_P_e_n_d_i_n_g and _S_C_G_e_t_E_v_e_n_t will set _S_C_e_r_r_n_o
  105.      to indicate the cause of the error.
  106.  
  107. EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
  108.      SCENOEVENTPENDING        No event pending
  109.  
  110.      SCECOMM                  Error communicating with scanner driver
  111.  
  112.      In addition, _S_C_E_v_e_n_t_P_e_n_d_i_n_g and _S_C_G_e_t_E_v_e_n_t may fail as the result of a
  113.      failed system call, in which case _S_C_e_r_r_n_o will be set to a value from
  114.      /_u_s_r/_i_n_c_l_u_d_e/_s_y_s/_e_r_r_n_o._h.
  115.  
  116. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  117.      _l_i_b_s_c_a_n(3), _s_e_l_e_c_t(2).
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.